{% import 'macros.html' as mymacros %}
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3>销售单预览</h3>
</div>
<div class="modal-body">
    <div class="row form-horizontal form-view">
        <fieldset>
            <div class='form3'>
                <div class="control-group">
                    <label class="control-label">付款方式</label>
                    <div class="controls">
                        {{ obj.payterm }}
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">总价</label>
                    <div class="controls">{{ obj.amount }}</div>
                </div>
                <div class="control-group">
                    <label class="control-label">折后价</label>
                    <div class="controls">{{ obj.realAmount }}</div>
                </div>
                <div class="control-group">
                    <label class="control-label">实付</label>
                    <div class="controls">{{ obj.payAmount }}</div>
                </div>
                <div class="control-group">
                    <label class="control-label">找零</label>
                    <div class="controls">{{ obj.refundAmount }}</div>
                </div>
            </div>
            <div class='form3'>
                <div class="control-group">
                    <label class="control-label">销售日期</label>
                    <div class="controls">{{ obj.soldTime|fd }}</div>
                </div>
                <div class="control-group">
                    <label class="control-label">员工</label>
                    <div class="controls">{{ obj.createBy }}</div>
                </div>
                <div class="control-group">
                    <label class="control-label">系统编号</label>
                    <div class="controls">{{ obj.no }}</div>
                </div>
                <div class="control-group">
                    <label class="control-label">会员</label>
                    <div class="controls">{{ obj.member.no if obj.member }}</div>
                </div>
            </div>
            <div class='form3'>
                <div class="control-group">
                    <label class="control-label">用途</label>
                    <div class="controls">{{obj.usage}}</div>
                </div>
                <div class="control-group">
                    <label class="control-label">备注</label>
                    <div class="controls">{{obj.remark}}</div>
                </div>
            </div>
        </fieldset>
    </div>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th width='202px'>商品编号/名称</th>
                <th width='40px'>数量</th>
                <th width='130px'>单价(RMB)</th>
                <th width='130px'>手工费(RMB)</th>
                <th width='100px'>合计(RMB)</th>
                <th>备注</th>
            </tr>
        </thead>
        <tbody>
            {% for dtl in obj.dtls %}
            <tr>
                <td>{{mymacros.render_goto_popup_pdt(dtl.pdt, loop.first)}} {{ dtl.pdtname }}</td>
                <td>{{ dtl.qty }}</td>
                <td>{{ dtl.realPrice }}</td>
                <td>{{ dtl.fee }}</td>
                <td>{{ dtl.realAmount }}</td>
                <td>{{ dtl.remark|f }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
<div class="modal-footer">
    <button type="button" data-dismiss="modal" class="btn btn-primary">{{BTN_CLOSE}}</button>
</div>